<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>显示所有用户信息</title>
<%    
String path = request.getContextPath();    
// 获得本项目的地址(例如: http://localhost:8080/MyApp/)赋值给basePath变量    
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";    
// 将 "项目路径basePath" 放入pageContext中，待以后用EL表达式读出。    
%>
<!-- 新 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="<%=basePath%>bootstrap-3.3.5/css/bootstrap.css">
<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="<%=basePath%>jquery-1.11.3/jquery.js"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="<%=basePath%>bootstrap-3.3.5/js/bootstrap.js"></script>
</head>
<body>
<div class="container">
	<h2 class="bg-info">展示用户</h2>
	<table class="table table-bordered table-hover">
	<thead>
	<tr>
		<th>Username</th>
		<th>Email</th>
		<th>Hobby</th>
		<th>操作</th>
	</tr>
	</thead>
	<c:forEach items="${users }" var="user">
		<tr>
			<td>
				${user.username }	
			</td>
			<td>${user.email }</td>
			<td>${user.hobby }</td>
			<td><a href="<%=basePath %>user/delUser/${user.id }.html">删除</a>|<a href="<%=basePath %>user/editUserUI/${user.id }.html">编辑</a></td>
		</tr>
	</c:forEach>
	</table>
	<a href="<%=basePath %>user/addUserUI.html">添加用户</a>
</div>
</body>
</html>
